home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / alien-glow-bar.scm < prev    next >
Encoding:
Text File  |  2005-06-30  |  3.2 KB  |  99 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Alien Glow themed hrule for web pages
  4. ; Copyright (c) 1997 Adrian Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ; This program is free software; you can redistribute it and/or modify
  8. ; it under the terms of the GNU General Public License as published by
  9. ; the Free Software Foundation; either version 2 of the License, or
  10. ; (at your option) any later version.
  11. ; This program is distributed in the hope that it will be useful,
  12. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ; GNU General Public License for more details.
  15. ; You should have received a copy of the GNU General Public License
  16. ; along with this program; if not, write to the Free Software
  17. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. (define (script-fu-alien-glow-horizontal-ruler length
  20.                            height
  21.                            glow-color
  22.                            bg-color
  23.                            flatten)
  24.   (let* ((img (car (gimp-image-new height length RGB)))
  25.      (border (/ height 4))
  26.      (ruler-layer (car (gimp-layer-new img
  27.                        (+ length height) (+ height height)
  28.                        RGBA-IMAGE "Ruler"
  29.                        100 NORMAL-MODE)))
  30.      (glow-layer (car (gimp-layer-new img
  31.                       (+ length height) (+ height height)
  32.                       RGBA-IMAGE "ALien Glow"
  33.                       100 NORMAL-MODE)))
  34.      (bg-layer (car (gimp-layer-new img
  35.                     (+ length height) (+ height height)
  36.                     RGB-IMAGE "Backround"
  37.                     100 NORMAL-MODE))))
  38.  
  39.     (gimp-context-push)
  40.  
  41.     (gimp-image-undo-disable img)
  42.     (gimp-image-resize img (+ length height) (+ height height) 0 0)
  43.     (gimp-image-add-layer img bg-layer 1)
  44.     (gimp-image-add-layer img glow-layer -1)
  45.     (gimp-image-add-layer img ruler-layer -1)
  46.      
  47.    ; (gimp-layer-set-preserve-trans ruler-layer TRUE)
  48.     (gimp-context-set-background bg-color)
  49.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  50.     (gimp-edit-clear glow-layer)
  51.     (gimp-edit-clear ruler-layer)
  52.     
  53.     (gimp-rect-select img
  54.               (/ height 2) (/ height 2)
  55.               length height CHANNEL-OP-REPLACE FALSE 0)
  56.     (gimp-context-set-foreground '(79 79 79))
  57.     (gimp-context-set-background '(0 0 0))
  58.  
  59.     (gimp-edit-blend ruler-layer FG-BG-RGB-MODE NORMAL-MODE
  60.              GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
  61.              FALSE 0 0 TRUE
  62.              0 0 height height)
  63.  
  64.     (gimp-context-set-foreground glow-color)
  65.     (gimp-selection-grow img border)
  66.     (gimp-edit-fill glow-layer FOREGROUND-FILL)
  67.     (gimp-selection-none img)
  68.     (plug-in-gauss-rle 1 img glow-layer 25 TRUE TRUE)
  69.  
  70.     (gimp-image-undo-enable img)
  71.  
  72.     (if (= flatten TRUE)
  73.     (gimp-image-flatten img))
  74.  
  75.     (gimp-display-new img)
  76.     
  77.     (gimp-context-pop)))
  78.  
  79.  
  80. (script-fu-register "script-fu-alien-glow-horizontal-ruler"
  81.             _"_Hrule..."
  82.             "Create an Hrule with the Alien Glow look"
  83.             "Adrian Likins"
  84.             "Adrian Likins"
  85.             "1997"
  86.             ""
  87.             SF-ADJUSTMENT _"Bar length"       '(480 5 1500 1 10 0 1)
  88.             SF-ADJUSTMENT _"Bar height"       '(16 1 100 1 10 0 1)
  89.             SF-COLOR      _"Glow color"       '(63 252 0)
  90.             SF-COLOR      _"Background color" '(0 0 0)
  91.             SF-TOGGLE     _"Flatten image"    TRUE)
  92.  
  93. (script-fu-menu-register "script-fu-alien-glow-horizontal-ruler"
  94.              _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow")
  95.